package com.beerbear.eurekaservicesecond.config;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: Beer Bear
 * @Description: 覆盖Ribbon默认的负载均衡规则
 * @Date: 2021/8/19 9:45
 */
@Configuration
public class RibbonRuleConfig {
    /**
     * create by: Beer Bear
     * description: 配置一个随机的负载均衡规则
     */
    @Bean
    public IRule randomRule(){
        return new RandomRule();
    }
}
